export const randomInt = (n) => {
  return Math.floor(Math.random() * n);
}
export const obj2Str = obj => {
  let t = Object.keys(obj).reduce((prev, next) => {
    prev = prev + next + '=' + obj[next] + '&'
    return prev
  }, '?')
  t = t.slice(0, -1) //去掉最后一个&
  return t
}